[Unit]
Description=cilium-consul
Documentation=https://github.com/cilium/cilium
Requires=docker.service

[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
ExecStartPre=/usr/bin/docker pull consul:1.1.0
ExecStartPre=-/usr/bin/docker rm -f cilium-consul
ExecStartPre=/usr/bin/docker create \
 --name 'cilium-consul'  -p 8500:8500 \
 -e CONSUL_LOCAL_CONFIG='{"skip_leave_on_interrupt": true, "disable_update_check": true}' \
 consul:1.1.0 agent -client=0.0.0.0 -server -bootstrap-expect 1 \

ExecStart= /usr/bin/docker start cilium-consul
ExecStop=-/usr/bin/docker rm -f cilium-consul

[Install]
WantedBy=multi-user.target
